<?php


namespace App\Http\Controllers\applets\api;


use App\Http\Controllers\applets\service\ParentSnService;
use App\Http\Controllers\applets\validate\ParentSn;
use App\Http\Controllers\utils\ToolUtil;
use Illuminate\Http\Request;

class ParentSnApi
{
    public function codeGetUsername(Request $request){
        $param = $request->all();
        $data = ParentSn::codeGetUsername($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return ParentSnService::codeGetUsername($param);
    }

    public function applyEmpower(Request $request){
        $param = $request->all();
        $data = ParentSn::applyEmpower($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return ParentSnService::applyEmpower($param);
    }

    public function bindParentSn(Request $request){
        $param = $request->all();
        $data = ParentSn::bindParentSn($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return ParentSnService::bindParentSn($param);
    }

    public function getEmpower(Request $request){
        $param = $request->all();
        $data = ParentSn::getEmpower($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return ParentSnService::getEmpower($param);
    }

    public function relieveEmpower(Request $request){
        $param = $request->all();
        $data = ParentSn::relieveEmpower($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return ParentSnService::relieveEmpower($param);
    }

    public function getFlatIsSuccess(Request $request){
        $param = $request->all();
        $data = ParentSn::getFlatIsSuccess($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return ParentSnService::getFlatIsSuccess($param);
    }

    public function relieveBindParentSn(Request $request){
        $param = $request->all();
        $data = ParentSn::relieveBindParentSn($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return ParentSnService::relieveBindParentSn($param);
    }

    public function getSnUid(Request $request){
        $param = $request->all();
        $data = ParentSn::getSnUid($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return ParentSnService::getSnUid($param);
    }

    
}